<template>
  <div>
    <h3>count的值是{{number}}</h3>
    <button @click="add">+1</button>
  </div>
</template>

<script>
export default {
  name:'MyCount',
  props:['number'],
  emits:['update:number'],
  methods:{
    add(){
      this.$emit('update:number',this.number+1)
    }
  }

}
</script>

<style>

</style>